package com.yonyou.iuap.corp.demo.yonbip.test;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

/**
 * @project: test305
 * @package: com.yonyou.iuap.corp.demo.yonbip.test
 * @description: TODO
 * @author: zhangshuai
 * @date: 2021年04月17日 20:55
 * @version: v1.0
 */
public class test001 {

    public static void main(String[] args) {
        String aa = "{\n" +
                " \"code\": \"200\",\n" +
                " \"message\": \"success\",\n" +
                " \"data\": [\n" +
                "  {\n" +
                "   \"id\": \"1999586160155648\",\n" +
                "   \"code\": \"13354910237\",\n" +
                "   \"user_id\": \"af49ebf5-58c3-4bc0-a53b-61cbd38d4e07\",\n" +
                "   \"name\": \"陈春玲\",\n" +
                "   \"modifiedtime\": \"2020-12-22T01:55:55.000+0000\",\n" +
                "   \"enable\": 1,\n" +
                "   \"mobile\": \"+86-133****0237\",\n" +
                "   \"org_id\": \"1999382797897984\",\n" +
                "   \"mainjobinfo\": [\n" +
                "    {\n" +
                "     \"id\": \"1999586160155649\",\n" +
                "     \"staff_id\": \"1999586160155648\",\n" +
                "     \"dept_id\": \"1999483517000448\",\n" +
                "     \"begindate\": \"2018-12-31T16:00:00.000+0000\",\n" +
                "     \"psncl_id\": \"c6e9e3a5d89c469f88fe956b744ac30c\",\n" +
                "     \"org_id\": \"1999382797897984\"\n" +
                "    }\n" +
                "   ]\n" +
                "  }\n" +
                " ]\n" +
                "}";
        JSONObject data = JSONObject.parseObject(aa);
        System.err.println("======>>>JSONObject:"+data);
        Object data1 = data.getJSONArray("data").get(0);
        JSONObject staff_data = (JSONObject) JSONObject.toJSON(data1);

        String staffId = staff_data.getString("id");
        System.err.println(staffId);
    }
}
